import request from "@/utils/request";

// 查询锁列表
export function listLock(params) {
  return request({
    url: "/enterprise/lock/houseLock/list",
    method: "get",
    params: params,
  });
}

// 根据区域查询房间锁信息列表
export function listLockByArea(params) {
  return request({
    url: "/enterprise/lock/houseLock/areaList",
    method: "get",
    params: params,
  });
}

// 新增锁
export function createLock(data) {
  return request({
    url: "/enterprise/lock/houseLock/create",
    method: "post",
    data: data,
  });
}

// 查询锁型号
export function listLockModel() {
  return request({
    url: "/enterprise/lock/houseLock/model/list",
    method: "get",
  });
}

//人脸信息列表
export function listLockFace(params) {
  return request({
    url: "/enterprise/lock/lockFace/list",
    method: "get",
    params: params,
  });
}

// 新增人脸
export function addLockFace(data) {
  return request({
    url: "/enterprise/lock/houseLock/addFace",
    method: "post",
    data: data,
  });
}

// 删除人脸
export function removeLockFace(id) {
  return request({
    url: "/enterprise/lock/houseLock/removeFace/"+id,
    method: "get",
  });
}

//密码列表
export function listLockPwd(params) {
  return request({
    url: "/enterprise/lock/lockPwd/list",
    method: "get",
    params: params,
  });
}

// 新增密码
export function addLockPwd(data) {
  return request({
    url: "/enterprise/lock/houseLock/addPwd",
    method: "post",
    data: data,
  });
}

// 删除密码{pwdId}
export function removeLockPwd(id) {
  return request({
    url: "/enterprise/lock/houseLock/removePwd/"+id,
    method: "get",
  });
}

// 换房
export function changeRoom(data) {
  return request({
    url: "/enterprise/lock/houseLock/changeRoom",
    method: "put",
    data: data,
    params: data
  });
}

// 变更锁状态和名称
export function updateLock(data) {
  return request({
    url: "/enterprise/lock/houseLock/updateLock",
    method: "put",
    data: data,
    params: data
  });
}

// 删除锁(lockid)
export function removeLock(id) {
  return request({
    url: "/enterprise/lock/houseLock/removeLock/"+id,
    method: "delete",
  });
}

// 获取开门记录
export function getOpenDoorRecord(params) {
  return request({
    url: "/enterprise/lock/houseLock/outerOpenDoorRecord",
    method: "post",
    params: params,
    data: params
  });
}

//获取冻结解冻记录
export function getFreezeRecord(params) {
  return request({
    url: "/enterprise/lock/freezeLog/list",
    method: "get",
    params: params,
  });
}

// 重新授权人脸
export function reAuthFace(data) {
  return request({
    url: "/enterprise/lock/houseLock/reAuthFace",
    method: "post",
    data: data
  });
}

